home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / insert_alist < prev    next >
Text File  |  2001-04-06  |  1KB  |  32 lines

  1. OPTIONAL
  2. SYNOPSIS
  3.         mixed* insert_alist (mixed key, mixed data..., mixed * alist)
  4.         int    insert_alist (mixed key, mixed * keys)
  5.  
  6. DESCRIPTION
  7.         1. Form: Alist Insertion
  8.  
  9.           The <key> and all following <data> values are inserted
  10.           into the <alist>. If an entry for <key> already exists
  11.           in the list, just the data values are replaced. The number
  12.           of <data> values must match the number of data arrays
  13.           in the alist, naturally.
  14.  
  15.           Result is the updated <alist>.
  16.  
  17.         2. Form: Key Insertion
  18.  
  19.           Insert the <key> into the (ordered) array of <keys>, so that
  20.           subsequent assoc()s can perform quick lookups. Result is the
  21.           index at which <key> was inserted (or already found).
  22.  
  23.           CAVEAT: when working with string keys, the index might no longer
  24.             be valid after the next call to insert_alist().
  25.  
  26.         Complexity: O(lg(n) + a*n) where n is the number of keys and
  27.         s is a very small constant (for block move);
  28.  
  29. SEE ALSO
  30.         alists(LPC), assoc(E), order_alist(E)
  31.  
  32.